double ff(double *x,double *par){
  return 40.*(1.-x[0]/36.);
}

void func(){

  TH1F *h = new TH1F("h","h",400,0,40);
  h->SetMaximum(40.0);

  TF1 *f = new TF1("f",ff,0,40,0);
  double r = f->Eval(34);

  cout << r << endl;

  f->SetLineColor(2);

  TCanvas *c = new TCanvas("c","c",800,600);
  h->Draw();
  f->Draw("same");

}
